-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: add release workflow for building binaries #260
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave this a quick review. Will have to test it thoroughly in a fork.
cross build --release --locked --target x86_64-unknown-linux-gnu | ||
cross build --release --locked --target armv7-unknown-linux-gnueabihf | ||
cross build --release --locked --target aarch64-unknown-linux-gnu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add macos & windows as well?, if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried with macos but gave up sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to take a look at this. How were you testing it?
.github/workflows/release.yml
Outdated
tar -czf "teos-${{github.ref_name}}-aarch64-linux-gnu.tar.gz" --transform 's|.*/||' "target/aarch64-unknown-linux-gnu/release/teosd" "target/aarch64-unknown-linux-gnu/release/teos-cli" | ||
tar -czf "teos-${{github.ref_name}}-armv7-linux-gnueabihf.tar.gz" --transform 's|.*/||' "target/armv7-unknown-linux-gnueabihf/release/teosd" "target/armv7-unknown-linux-gnueabihf/release/teos-cli" | ||
tar -czf "teos-${{github.ref_name}}-x86_64-linux-gnu.tar.gz" --transform 's|.*/||' "target/x86_64-unknown-linux-gnu/release/teosd" "target/x86_64-unknown-linux-gnu/release/teos-cli" | ||
tar -czf "watchtower-client-${{github.ref_name}}-aarch64-linux-gnu.tar.gz" --transform 's|.*/||' "target/aarch64-unknown-linux-gnu/release/watchtower-client" | ||
tar -czf "watchtower-client-${{github.ref_name}}-armv7-linux-gnueabihf.tar.gz" --transform 's|.*/||' "target/armv7-unknown-linux-gnueabihf/release/watchtower-client" | ||
tar -czf "watchtower-client-${{github.ref_name}}-x86_64-linux-gnu.tar.gz" --transform 's|.*/||' "target/x86_64-unknown-linux-gnu/release/watchtower-client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's split this part into its own step for a little bit more readability.
Also, what do you think about removing the gnu
& gnueabihf
endings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally i don't care about these. I removed them.
38eef37
to
6972d03
Compare
@@ -16,7 +16,7 @@ path = "src/main.rs" | |||
backoff = { version = "0.4.0", features = ["tokio"] } | |||
hex = { version = "0.4.3", features = [ "serde" ] } | |||
home = "0.5.3" | |||
reqwest = { version = "0.11", features = [ "blocking", "json", "socks" ] } | |||
reqwest = { version = "0.11", default-features = false, features = [ "blocking", "json", "socks", "rustls-tls" ] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is rustls-tls
required now?
# - name: Get Changelog Entry | ||
# id: changelog_reader | ||
# uses: mindsers/changelog-reader-action@v2 | ||
# with: | ||
# version: ${{ steps.tag_name.outputs.current_version }} | ||
# path: ./CHANGELOG.md | ||
|
||
# - name: Get tag message | ||
# id: get_tag_message | ||
# run: | | ||
# TAG_NAME=$(echo "${GITHUB_REF}" | sed 's/refs\/tags\///') | ||
# TAG_MESSAGE=$(git for-each-ref --format='%(contents)' "refs/tags/${TAG_NAME}") | ||
# echo "tag_name=${TAG_NAME}" >> "$GITHUB_OUTPUT" | ||
# echo "tag_message=${TAG_MESSAGE}" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be cleaned
# body: "${{ steps.changelog_reader.outputs.changes }} \n\n### Release binaries info\n\n- Release binaries were built using rust ${{ needs.build.outputs.rust-version }}\n- Linux release binaries require glibc>=2.31" | ||
# body: "${{ steps.get_tag_message.outputs.tag_message }} \n\n### Release binaries info\n\n- Release binaries were built using rust ${{ needs.build.outputs.rust-version }}\n- Linux release binaries require glibc>=2.31" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ca be cleaned
cross build --release --locked --target x86_64-unknown-linux-gnu | ||
cross build --release --locked --target armv7-unknown-linux-gnueabihf | ||
cross build --release --locked --target aarch64-unknown-linux-gnu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to take a look at this. How were you testing it?
This PR adds a workflow to create a release with release binaries.
It cross compiles for:
x86_64-unknown-linux-gnu
aarch64-unknown-linux-gnu
armv7-unknown-linux-gnueabihf
using cross and only requires glibc >= 2.31.
I packaged
teosd
andteos-cli
together whilewatchtower-client
is in an extra archive.For better cross compatibility i removed the dependency to the system specific
openssl
and replaced it withrustls-tls
.For this job to trigger you have to push an annotated tag. It will only trigger on tags that represent final releases.
This project does not have a CHANGELOG.md so i commented in two methods on how to provide the content body for the release:
You can of course also just edit the release body manually on the website but then it won't show in the notification email that is send to users.